package cn.mrcode.fd.plugin.security;

import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.eis.SessionIdGenerator;

import java.io.Serializable;
import java.util.UUID;

/**
 * @author zhuqiang
 * @version V1.0
 * @date 2016/7/19 0019 16:18
 */
public class JavaUuidSessionIdGenerator implements SessionIdGenerator {
    private String prefix = "SESID_"; //session id前缀
    public Serializable generateId(Session session) {
        return prefix + UUID.randomUUID().toString();
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }
}
